Skip to content

perf(artifacts): artifacts list reads mtimes in batches and formats times without date (CC-698, refs #749) - #789

Merged
screenleon merged 2 commits into
mainfrom
perf/artifacts-list-749
Nov 6, 2026
Merged

screenleon merged 2 commits into
mainfrom
perf/artifacts-list-749

Conversation

@screenleon

Copy link
Copy Markdown
Owner

Summary

  • pmctl artifacts list started basename, date, several stat and command-substitution subshells for every run; on native Windows that is about 0.18 s per run (perf(artifacts): Windows 列出數十筆 run 約需一分鐘,需批次 metadata/時間格式化 #749). It now reads all mtimes in stat calls of 50 paths, formats times with bash's printf '%(...)T' (falling back to date only if the builtin fails) and takes the run id with parameter expansion. Sorting, the time source (newest top-level footer, else the run directory) and the output format are unchanged.
  • Also carries the docs/platform-support.md note for CC-697 (large diffs: scope manifest cost, scan_stopped_early, the accepting rerun scans again) and records pr:#788 on CC-697, per the rule that docs ride with a ticket PR.

Refs #749 (stays open: no --limit, no 1000-run point, no process counts, no Linux/WSL run).

Measurement (native Windows, same fixture, wall-clock, cmp of old and new output identical at every size)

runs before after
0 1.24 s 0.65 s
10 2.5 s 0.97 s
60 10.7 s 1.29 s
200 36.1 s 2.1 s

The fixture mixes runs with no footer, two footers and equal timestamps. The "before" numbers come from git archive HEAD of the parent commit, run against the same state root.

Verification

  • bash tests/shell/test-pmctl-artifacts.sh: 45 passed, 0 failed, 3 skipped (no real symlinks / no flock on this platform).
  • BACKLOG validator and planning-status consistency pass.

Review (commands/ship.md Step 2.5)

  • Step 2.5: the old per-run helpers pmctl_artifacts_run_created_epoch and the date-only pmctl_artifacts_epoch_to_ts were used only by the list; the first is removed and the second now sets REPLY. pmctl_artifacts_file_mtime stays for gc.

  • No pr-gate round was run on this PR.

  • Permanent test admissions: pmctl artifacts list: batched mtimes keep footer, directory and tie semantics is a new permanent test. It pins behaviour the batching could silently change (120 runs, more than one stat batch of 50, newest of two footers, a footer-less run taking its directory's time, UTC formatting) and no existing case covers more than two runs.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ESW7P9wHJRbhxx3v7XyQuq

screenleon and others added 2 commits November 6, 2026 14:53
…imes without date (CC-698, refs #749)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESW7P9wHJRbhxx3v7XyQuq
…and a non-UTC TZ (CC-698, refs #749)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ESW7P9wHJRbhxx3v7XyQuq
@screenleon
screenleon merged commit 2288b7f into main Nov 6, 2026
89 checks passed
@screenleon
screenleon deleted the perf/artifacts-list-749 branch November 6, 2026 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant